package com.seller.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.seller.service.SellerManager;
import com.seller.vo.Seller;


@Controller
public class SellerManageController {
	
	@Autowired(required=true)
	private SellerManager sm ;
	
	@RequestMapping("/login")
	public String login(String sellerTel,String sellerPsd,HttpServletRequest request){
		
		Seller seller = sm.loginSeller(sellerTel, sellerPsd);
		
		if(seller != null){
			
			request.getSession().setAttribute("seller", seller);
			
			return "WEB-INF/jps/loginSuc";
			
		}else{
			return "login";
		}
		
	}
	
	@RequestMapping("/regist")
	public String regist(SellerManager seller,HttpServletRequest request){
		
		return "regist";
		
	}
	
	
	
	
}
